/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package commands;

import javax.swing.JTree;

/**
 *
 * @author umutcan
 */
public class GroupCommander {
    
    private AddGroupCommand addGroup;
    private RemoveGroupCommand removeGroup;
    private JTree treeGruplar;
    
    public GroupCommander(AddGroupCommand addGroup, RemoveGroupCommand removeGroup, JTree treeGruplar)
    {
        this.treeGruplar = treeGruplar;
        this.addGroup = addGroup;
        this.removeGroup = removeGroup;
    }

    public GroupCommander(JTree treeGruplar) {
        this.treeGruplar = treeGruplar;
    }
    public void add()
    {
        addGroup.execute(treeGruplar);
    }
    public void remove()
    {
        removeGroup.execute(treeGruplar);
    }

    /**
     * @param addGroup the addGroup to set
     */
    public void setAddGroupCommand(AddGroupCommand addGroup) {
        this.addGroup = addGroup;
    }

    /**
     * @param removeGroup the removeGroup to set
     */
    public void setRemoveGroupCommand(RemoveGroupCommand removeGroup) {
        this.removeGroup = removeGroup;
    }
    
    
}
